The present invention relates to an image processing apparatus used for an automatic mailing address reader, and in particular to an image processing apparatus that extracts specific areas, including mailing address areas.
The postal service system daily processes a large amount of mail within a short period of time. When all mail was sorted visually and manually, the size of the work load borne by postal service employees was very large. To reduce this work load, mechanization, including automatic readers, has been introduced. This has led to the development of an advanced procedure whereby mail to be delivered is sorted by district. This way of handling mail has been successful in Japan because postal codes are entered in boxes provided for them on mailing matter; however, for overseas mail, for which no clearly defined spaces for postal code entries are provided, it is difficult to mechanically determine where postal codes are located on mailing matter. Moreover, since it is anticipated that the amount of overseas mail processed will continually increase, currently a demand exists for the continued development of present techniques to permit the immediate reading of address information, including postal codes, carried by mail, and for sorting the mail for delivery by districts.
Although there is a strong demand for the extraction of postal codes carried by mailing matter for which postal code entry areas are not defined, and for the reading of address information, it is difficult to use current techniques for these purposes. This is primarily because on the exterior surfaces of the various items that constitute the mail, not only are there areas provided for recipient addresses, but there may be other areas in which sender addresses are entered, areas in which advertising material is presented, and areas in which various patterns, such as drawings and photographs, are displayed. Further compounding the problem are the many ways in which entries are made, including the use of handwritten and mechanically printed characters, and of vertical and horizontal writing styles. As a result, in order to correctly separate postal codes and other address data from the various coexisting information entries carried by the mail, a very complicated process must be employed, such as one that provides for the examination of all external surfaces.
Of the conventional methods that are used to extract address information, techniques exist by which address areas and actual addresses can be identified and read. Included is a method whereby it is presumed that labels bearing printed addresses are attached to mail. For this method the reflection attributes of the labels, or the shadows thrown by the edges of the labels, are detected and the address areas are thereafter extracted. There is also a method whereby horizontal and vertical projections of the mail are obtained and are used to select probable address areas, in which zones containing high entry densities are defined as character rows. In addition, in Japanese Unexamined Patent Publication No. Hei 7-265807 a technique is disclosed to extract character rows, in which connected components that are near each other are joined together, and the character rows are later combined to define probable address areas.
The method that provides for the extraction, from accompanying entries, of address areas by presuming that printed address labels are attached to mail is definitely useless with the large volume of mail where addresses are printed directly on external surfaces. With the method selecting probable mailing address areas by defining as character rows zones having high entry densities, it is difficult to separate address areas from their background if the background contains a large amount of image data.
According to the technique disclosed in Japanese Unexamined Patent Publication No. Hei 7-265807, a complicated joining process is performed. Portions from which pixels are accumulated are detected by examining all pixels. This detailed examination is repeated for each portion involved. With this technique, logic operations are very difficult, processing speeds are reduced, and configurations are too complicated.
It is, therefore, one object of the present invention to avoid the use of a complicated process to combine pixels, and to quickly and precisely extract specific areas, such as address areas.
It is another object of the present invention to extract several probable address areas that are free of extraneous patterns and noise, and to considerably simplify the process that follows thereafter.
To achieve the above objects, according to the present invention, an area extraction method comprises the steps of: extracting connected components from an input image; comparing the sizes of the connected components with a predetermined threshold size, and extracting connected components occupying ranges within the predetermined threshold size; dividing the input image into segments and assuming that the segments are mesh images having a predetermined size, and setting to the ON state the mesh images that correspond to the connected components occupying ranges within the predetermined threshold size that is extracted; and extracting a specific area from the connectivity of the mesh images that are in the ON state.
It is preferable that the input image be an image of mail that includes an address area, and that a probable address area be extracted at the step for extracting the specific area, so that the address area can be precisely extracted from the mail image wherein various information coexists.
It is preferable that, at the step for extracting the connected components occupying ranges within the predetermined threshold size, the connected components occupying ranges within the predetermined threshold size be extracted by comparing the height and/or width of the connected components with a predetermined height and/or width of a character at an assumed address, so that the connected components, for example, can be detected with noise removed, and that more precise extraction of the address area can be performed. More specifically, if the height and/or width of the connected components is equal to or smaller than a first constant value (e.g., 30 points at a resolution for the compression of 4 lines/mm), it can be ascertained that the pertinent connected components occupy ranges within the threshold size. In addition, a threshold size can be designated while the heights and/or widths of the connected components consist of rectangular areas. Since such a threshold value is set, printed characters in the background that are not related to address characters can be eliminated, and thin lines, such as broken lines and the lines formed by the edges labels, can be disregarded.
Furthermore, it is preferable that the sizes of the mesh images that are segments of the input image be determined to occupy ranges having sizes equal to the sizes of large characters in the address that is assumed. Thus, the process can be simplified by focusing on the characters in a mailing address. For a range that is equal to the size of a large character, assuming a maximum 30 points, a square area of 24xc3x9724 points can be selected as a mesh image.
Further, at the step of setting the mesh images to the ON state, a mesh image that includes the center coordinates of the connected components occupying ranges within the predetermined threshold size is set to the ON state.
Furthermore, according to the present invention, a method for extracting an address area comprises the steps of: extracting connected components having a predetermined size from an input image that includes an address area; dividing the input image into small areas and assuming simplified quadrilateral areas of one point each; determining a corresponding quadrilateral area to which the extracted connected components belong; and extracting a probable address area from the pixel""s connection state of the corresponding quadrilateral area to which it is determined the connected components belong.
It is preferable that, at the step of extracting a probable address area, a plurality of attributes be determined and a proposed address be extracted, so that the probable address area can be more precisely determined. Specifically, attributes, such as whether there are character strings that extend along two or more lines, whether a sufficient number of quadrilateral areas are present, whether characters are located close to the edge of an image, and whether the shape of character strings appear to be aline with one for an address, are combined for use.
It is preferable that, at the step of extracting a probable address area, a priority order be designated for the character strings by determining whether the shape of character strings resemble the one for an address. Thus, the actual address reading can be begun in accordance with assigned priorities, and as the process is terminated when the address has been read, an increase in the processing speed is thereby be enabled.
According to the present invention, an apparatus for extracting an address area comprises: a connected component extraction means for extracting connected components having a predetermined size from an input image that includes an address area; a quadrilateral area assumption means for dividing the input image into small areas and for assuming the existence of simplified quadrilateral areas of one point each; a corresponding quadrilateral area determination means for determining a corresponding quadrilateral area to which the connected components extracted by the connected component extraction means belong; and a probable address area extraction means for extracting a probable address area from the pixel""s connection state of the quadrilateral area that is determined by the corresponding quadrilateral area determination means.
The connected component extraction means employs a block of 8-connected components arranged vertically, horizontally or obliquely, or a block of 4-connected components arranged vertically or horizontally, to extract connected components occupying ranges within a predetermined threshold size. The quadrilateral area assumption means may divide an input image into small areas having a predetermined size, or may dynamically determine the size of small areas, in accordance with the distribution condition of connected components, and assume quadrilateral areas. The quadrilateral areas may be square areas or rectangular areas having different lengths in the primary scanning direction and in the sub-scanning direction. The corresponding quadrilateral area determination means may determine, as a corresponding quadrilateral area, a quadrilateral area wherein the center portion of the connected component extracted by the connected component extraction means is present, or may determine, as a corresponding quadrilateral area, a quadrilateral area wherein connected components are even slightly overlapped.
It is preferable that the probable address area extraction means extract, as a probable address area, a quadrilateral area that at the least encloses a 4-connected component each arranged vertically and horizontally in the corresponding quadrilateral area, so that extraction of the address area can be very precisely performed. A quadrilateral area enclosing an 8-connected component each arranged vertically, horizontally and obliquely can also be defined as a probable address area.
According to the present invention, an image processing apparatus comprises: an image input unit for entering an image; a binarization unit for obtaining a binary image for the image entered by the image input unit; a connected component detector for detecting connected components obtained by the binarization unit; a comparator for comparing the size of the connected components detected by the connected component detector with a predetermined threshold size; a mesh image forming unit for dividing the image entered by the image input unit into mesh images having a predetermined size; a corresponding mesh image detector for detecting, from the mesh images formed by the mesh image forming unit, a mesh image that corresponds to a connected component that is determined by the comparator to occupy a range within the threshold size; a specific area extraction unit for extracting a specific area in accordance with the connection state of the corresponding mesh image that is detected by the corresponding mesh image detection unit; and an image recognition unit for recognizing an image that is located in the specific area extracted by the specific area extraction unit.
The image entered by the input unit is of mail, including an address, and the threshold size used by the comparator is determined in accordance with a size that is assumed for a character in the address.
Furthermore, it is preferable that the predetermined size for the mesh images is determined based on the size of an address. Therefore, an address area for mail can be extracted quickly and precisely, while taking into account the size of the characters used in the address.
In addition, the predetermined size used by the mesh image forming unit is determined based on the size of the connected components detected by the connected component detector. Thus, compared with the prior art, wherein a complicated joining process is performed for all the pixels, the logic operation is very simple and the processing speed is increased.